using UnityEngine;
using System.Collections;

public class bulletClass : MonoBehaviour {
	
	public float moveSpeed = 0.1f;
	private float anglez;
	private float xMove;
	float yMove;
	int timer = 0;
	public bool gameStopped = false;
	void Start () {
		//float k = 1f;
	//	anglew = transform.rotation.eulerAngles.x*100;
		//anglex = transform.rotation.eulerAngles.x*100;
		//angley = transform.rotation.eulerAngles.y*100;
		anglez = -transform.rotation.eulerAngles.z*Mathf.PI/180;
		//anglez = 3.14f;
		xMove = moveSpeed*Mathf.Sin(anglez);
		yMove = moveSpeed*Mathf.Cos(anglez);
		//xMove = moveSpeed*Mathf.Sin(transform.rotation.w*k);
		//yMove = moveSpeed*Mathf.Cos(transform.rotation.w*k);
	}
	/*public void setPause(bool pause){
		if (pause){
			gameStopped = true;
		}else{
			gameStopped = false;
		}
	}*/
	public void moveMe(){
		this.gameObject.transform.position = new Vector3(this.gameObject.transform.position.x + xMove,
			this.gameObject.transform.position.y + yMove, -1);
	}
	
	// Update is called once per frame
	void Update () {
		//this.gameObject.transform.position = new Vector3(this.gameObject.transform.position.x + xMove,
		//	this.gameObject.transform.position.y + yMove, -1);
		//Destroy(this.gameObject);
		/*timer += 1;
		if(timer > 20){
			Destroy(this.gameObject);
		}*/
	//	this.gameObject.
	}
	/*void OnTriggerEnter(Collider collision) {
        if (collision.gameObject.name.Contains("BadGuy")){
			Destroy(collision.gameObject);
			Destroy(this.gameObject);
			gv.bulletList.Remove(this.gameObject);
		}
    }*/
}
